package Demo2;
//实现一个跑的接口
public interface IRunning {
    //跑
    public abstract void run();
}
//游泳
interface ISwimming{
    public abstract void swim();
}
//接口的多‘继承’，接口间用逗号隔开
interface  IAmphibious extends ISwimming,IRunning{
    //具备两个接口的特性
}
//使用IAmphibious使用将其接口继承的抽象方法全部重新
class Dog implements IAmphibious{
    //重写run方法
    @Override
    public void run() {
        System.out.println("狗在跑......");
    }
    //重写swim方法
    @Override
    public void swim() {
        System.out.println("狗在游泳......");
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.run();
        dog.swim();
    }
}
